package be.kuleuven.cs.mop.domain.exceptions;


public class InvalidCurrentUserException extends Exception {

	private static final long serialVersionUID = 3620255659122531871L;
	public static final int NO_USER_LOGGED_IN = 1;
	public static final int USER_NOT_QUALIFIED_TO_EXECUTE = 2;
	public static final int USER_NOT_OWNER_OF_TASK = 3;
	
	public int errorCode = 0;
	public InvalidCurrentUserException(int errorCode){
		super();
		this.errorCode = errorCode;
	}

	@Override
	public String getMessage(){
		switch(getErrorCode()){
		case NO_USER_LOGGED_IN : return "There is no logged in user.";
		case USER_NOT_QUALIFIED_TO_EXECUTE : return "The currently logged in user does not have sufficient access permissions to execute this Use Case.";
		case USER_NOT_OWNER_OF_TASK : return "The currently logged in user is not the owner of this Task.";
		default : return "User error";
		}
			
	}
	
	public int getErrorCode(){
		return this.errorCode;
	}
	
}
